package at.fhooe.mc.view;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Polygon;

import javax.swing.JPanel;

public class JCirclePanel extends JPanel  {

	private Color circleColor = Color.lightGray;
	private Integer floorNumber = 1;
	private boolean onOff = false;

	public void setFloorNumber(int number){

		floorNumber = number;

	}

    public Color getTrianglecolor() {
        return circleColor;
    }

	public void setTrianglecolor(boolean on) {
		onOff = on;
		this.repaint();
	}

protected void paintComponent(Graphics g) {

		super.paintComponent(g);
		g.setColor(circleColor);
		if(onOff){
			circleColor = Color.green;
			g.setColor(circleColor);
			g.fillOval(15, 5, 9, 9);
		} else {
			circleColor = Color.lightGray;
			g.setColor(circleColor);
			g.fillOval(15, 5, 9, 9);
		}
		g.setFont(new Font("Helvetica", Font.PLAIN, 13));
		g.setColor(Color.black);
		if(floorNumber == 10){
			g.drawString(floorNumber.toString(), 0, 15);
		} else {
			g.drawString(floorNumber.toString(), 5, 15);
		}
	}

}
